gsk: move transform structure to private.h
authorChristian Hergert <chergert@redhat.com>
Thu, 11 Feb 2021 00:04:20 +0000 (16:04 -0800)
committerChristian Hergert <chergert@redhat.com>
Thu, 11 Feb 2021 00:14:59 +0000 (16:14 -0800)
This allows using the category without having to call a function from the
hot paths of the renderer.

gsk/gsktransform.c
gsk/gsktransformprivate.h

index 9361f25b9a946b4196f92737ba6b246233924c8c..ae8a25d904862ee165de55e8f573ea83c3f38921 100644 (file)
 
 #include "gsktransformprivate.h"
 
-typedef struct _GskTransformClass GskTransformClass;
-
-struct _GskTransform
-{
-  const GskTransformClass *transform_class;
-
-  GskTransformCategory category;
-  GskTransform *next;
-};
-
 struct _GskTransformClass
 {
   gsize struct_size;
@@ -1747,7 +1737,7 @@ gsk_transform_equal (GskTransform *first,
  * Returns: The category of the transform
  **/
 GskTransformCategory
-gsk_transform_get_category (GskTransform *self)
+(gsk_transform_get_category) (GskTransform *self)
 {
   if (self == NULL)
     return GSK_TRANSFORM_CATEGORY_IDENTITY;
index 9f88e9a002874fbb2cbd0f9abcb74842c94d1ff1..a7871c35f4fb5f715d993965b6cf0620035cf00a 100644 (file)
 
 G_BEGIN_DECLS
 
+typedef struct _GskTransformClass GskTransformClass;
+
+struct _GskTransform
+{
+  const GskTransformClass *transform_class;
+
+  GskTransformCategory category;
+  GskTransform *next;
+};
 
 gboolean                gsk_transform_parser_parse              (GtkCssParser           *parser,
                                                                  GskTransform          **out_transform);
@@ -45,6 +54,8 @@ void gsk_matrix_transform_rect    (const graphene_matrix_t  *m,
                                    const graphene_rect_t    *r,
                                    graphene_quad_t          *res);
 
+#define gsk_transform_get_category(t) ((t) ? (t)->category : GSK_TRANSFORM_CATEGORY_IDENTITY)
+
 G_END_DECLS
 
 #endif /* __GSK_TRANSFORM_PRIVATE_H__ */